<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: imu_interface.c File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">imu_interface.c File Reference</div>  </div>
</div>
<div class="contents">

<p>High level IMU interface.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="imu__interface_8h_source.html">imu_interface.h</a>&quot;</code><br/>
<code>#include &quot;conf_spi_master.h&quot;</code><br/>
<code>#include &quot;<a class="el" href="nav__types_8h_source.html">nav_types.h</a>&quot;</code><br/>
<code>#include &lt;gpio.h&gt;</code><br/>
<code>#include &lt;spi.h&gt;</code><br/>
<code>#include &lt;spi_master.h&gt;</code><br/>
</div><table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga1675e8544a889ebf498d8a076eafd13a">MAX_LOG2_NR_FILTER_TAPS</a>&#160;&#160;&#160;4</td></tr>
<tr><td colspan="2"><div class="groupHeader">IMU commands</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga4cbbbb74258f1330950dddfd7e059885">BURST_READ</a>&#160;&#160;&#160;0x3E00</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga95952a1aa5066a0ee395544b1d00f5b6">PRECISION_GYRO_BIAS_CALIBRATION</a>&#160;&#160;&#160;0xBE10</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga32b21aed5e8b0b591638c29805ea49a2">SET_NR_FILTER_TAPS</a>&#160;&#160;&#160;0xB8</td></tr>
<tr><td colspan="2"><div class="groupHeader">Scaling of IMU raw data</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gacf1763c4ed2b219ea3a67c92d9740186">SUPPLY_SCALE</a>&#160;&#160;&#160;0.002418f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gabdeac7f9288bf09fd6e1739d22ff8bea">GYRO_SCALE</a>&#160;&#160;&#160;0.00087266f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga12c7b17bb03dc66dac226cdfe74f3c2d">ACC_SCALE</a>&#160;&#160;&#160;0.0081643275f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga37fc2eea145b1cf777795b062ce43500">TEMP_SCALE</a>&#160;&#160;&#160;0.0085f</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gacf1763c4ed2b219ea3a67c92d9740186">SUPPLY_SCALE</a>&#160;&#160;&#160;0.000151125f</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gaffa3d61bdee6ac9ce4d8c30017fca3c9">imu_interface_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization routine for the IMU to MCU interface.  <a href="group__imu__interface.html#gaffa3d61bdee6ac9ce4d8c30017fca3c9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gae38a1d022cfc792215e943bdfd63483a">convert_inert_readings</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts raw (integer) inertial readings to float SI units.  <a href="group__imu__interface.html#gae38a1d022cfc792215e943bdfd63483a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gab9e72cf471b9cdc12145d3d185fe5f05">convert_auxiliary_data</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts raw (integer) auxiliary data readings to float SI units.  <a href="group__imu__interface.html#gab9e72cf471b9cdc12145d3d185fe5f05"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga646f88d2978376b42020975d5802919d">imu_burst_read</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Request and reads all sensor output data from IMU.  <a href="group__imu__interface.html#ga646f88d2978376b42020975d5802919d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga71833d5eb4e7c71baaaa9e707a6c1f8d">precision_gyro_bias_null_calibration</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the internal IMU gyro calibration routine.  <a href="group__imu__interface.html#ga71833d5eb4e7c71baaaa9e707a6c1f8d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gaba5c2c784f3302cfb7972bbf5fef48d2">low_pass_filter_setting</a> (uint8_t nr_filter_taps)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the number of filter taps of the IMU internal low pass filter.  <a href="group__imu__interface.html#gaba5c2c784f3302cfb7972bbf5fef48d2"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">Global IMU output variables</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Global variable used for making sensor readings available to other parts of the program. The variables will contain the latest read out sensor readings. The values are scaled to SI units apart from the temperature which is in <img class="formulaInl" alt="$^circ C$" src="form_12.png"/>. Angels are given in radians. </p>
</div></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gaf92cab44915b7d9faaf5aeadb328bae6">accelerations_in</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><img class="formulaInl" alt="$[m/s^2]$" src="form_13.png"/>  <a href="group__imu__interface.html#gaf92cab44915b7d9faaf5aeadb328bae6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga8cac4b2812dcb492989d7122c5eb0bfb">angular_rates_in</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><img class="formulaInl" alt="$[rad/s]$" src="form_14.png"/>  <a href="group__imu__interface.html#ga8cac4b2812dcb492989d7122c5eb0bfb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a90c683614d896321009d3b3c401b764f">vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#gacd438fa96131e9024d8ad206d83ffb66">imu_temperaturs</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><img class="formulaInl" alt="$[^circ C]$" src="form_15.png"/>  <a href="group__imu__interface.html#gacd438fa96131e9024d8ad206d83ffb66"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="nav__types_8h.html#a37e1884b1f06826c49607cec459b4e8a">precision</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__imu__interface.html#ga3f561003deb253bcc716a6c690c87cfe">imu_supply_voltage</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><img class="formulaInl" alt="$[V]$" src="form_16.png"/>  <a href="group__imu__interface.html#ga3f561003deb253bcc716a6c690c87cfe"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>High level IMU interface. </p>
<p>This file declares the high level interface functions used by the rest of the system to interact with the IMU. The functions work for all IMUs in the Analog Devices iSensor (R) serie. The communication is done via a SPI interface. Before the functions are called the initialization routine (<a class="el" href="group__imu__interface.html#gaffa3d61bdee6ac9ce4d8c30017fca3c9" title="Initialization routine for the IMU to MCU interface.">imu_interface_init()</a>) must be called to set up the SPI interface. The SPI interface settings are found in conf_spi_master.h.</p>
<dl class="author"><dt><b>Authors:</b></dt><dd>John-Olof Nilsson, Isaac Skog </dd></dl>
<dl class="copyright"><dt><b>Copyright:</b></dt><dd>Copyright (c) 2011 OpenShoe, ISC License (open source) </dd></dl>
</div></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Dec 20 2011 12:12:36 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
